package com.example.pattern.builder;

public class BuilderTestV2 {

    public static void main(String[] args) {
        Product product = new Product().setName("acai").setAge(25).setAddress("earth");
        System.out.println(product);
    }

}
class Product{

    private String name;
    private int age;
    private String address;

    public Product setName(String name){
        this.name = name;
        return this;
    }

    public Product setAge(int age){
        this.age = age;
        return this;
    }

    public Product setAddress(String address){
        this.address = address;
        return this;
    }

    @Override
    public String toString() {
        return "Product{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", address='" + address + '\'' +
                '}';
    }
}